<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      5.8.&nbsp;Libstdc++-6.3.0
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>
  <body class="lfs" id="lfs-8.0-systemd">
    <div class="navheader">
      <h4>
        Linux From Scratch - Version 8.0-systemd
      </h4>
      <h3>
        Chapter&nbsp;5.&nbsp;Constructing a Temporary System
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="glibc.html" title="Glibc-2.25">Prev</a>
          <p>
            Glibc-2.25
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="binutils-pass2.html" title=
          "Binutils-2.27 - Pass 2">Next</a>
          <p>
            Binutils-2.27 - Pass 2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter05.html" title=
          "Chapter&nbsp;5.&nbsp;Constructing a Temporary System">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 8.0-systemd">Home</a>
        </li>
      </ul>
    </div>
    <div class="wrap" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="ch-tools-libstdcpp" name="ch-tools-libstdcpp"></a>5.8.
        Libstdc++-6.3.0
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <p>
          Libstdc++ is the standard C++ library. It is needed for the correct
          operation of the g++ compiler.
        </p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Approximate build time:</strong>
              <span class="segbody">0.4 SBU</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Required disk space:</strong>
              <span class="segbody">898 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          5.8.1. Installation of Target Libstdc++
        </h2>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            <span class="application">Libstdc++</span> is part of the GCC
            sources. You should first unpack the GCC tarball and change to
            the <code class="filename">gcc-6.3.0</code> directory.
          </p>
        </div>
        <p>
          Create a separate build directory for Libstdc++ and enter it:
        </p>
        <pre class="userinput">
<kbd class="command">mkdir -v build
cd       build</kbd>
</pre>
        <p>
          Prepare Libstdc++ for compilation:
        </p>
        <pre class="userinput">
<kbd class="command">../libstdc++-v3/configure           \
    --host=$LFS_TGT                 \
    --prefix=/tools                 \
    --disable-multilib              \
    --disable-nls                   \
    --disable-libstdcxx-threads     \
    --disable-libstdcxx-pch         \
    --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/6.3.0</kbd>
</pre>
        <div class="variablelist">
          <p class="title">
            <strong>The meaning of the configure options:</strong>
          </p>
          <dl class="variablelist">
            <dt>
              <span class="term"><em class=
              "parameter"><code>--host=...</code></em></span>
            </dt>
            <dd>
              <p>
                Indicates to use the cross compiler we have just built
                instead of the one in <code class="filename">/usr/bin</code>.
              </p>
            </dd>
            <dt>
              <span class="term"><em class=
              "parameter"><code>--disable-libstdcxx-threads</code></em></span>
            </dt>
            <dd>
              <p>
                Since we have not yet built the C threads library, the C++
                one cannot be built either.
              </p>
            </dd>
            <dt>
              <span class="term"><em class=
              "parameter"><code>--disable-libstdcxx-pch</code></em></span>
            </dt>
            <dd>
              <p>
                This switch prevents the installation of precompiled include
                files, which are not needed at this stage.
              </p>
            </dd>
            <dt>
              <span class="term"><em class=
              "parameter"><code>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/6.3.0</code></em></span>
            </dt>
            <dd>
              <p>
                This is the location where the standard include files are
                searched by the C++ compiler. In a normal build, this
                information is automatically passed to the Libstdc++
                <span class="command"><strong>configure</strong></span>
                options from the top level directory. In our case, this
                information must be explicitly given.
              </p>
            </dd>
          </dl>
        </div>
        <p>
          Compile libstdc++ by running:
        </p>
        <pre class="userinput">
<kbd class="command">make</kbd>
</pre>
        <p>
          Install the library:
        </p>
        <pre class="userinput">
<kbd class="command">make install</kbd>
</pre>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <p>
          Details on this package are located in <a class="xref" href=
          "../chapter06/gcc.html#contents-gcc" title=
          "6.17.2.&nbsp;Contents of GCC">Section&nbsp;6.17.2, &ldquo;Contents
          of GCC.&rdquo;</a>
        </p>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="glibc.html" title="Glibc-2.25">Prev</a>
          <p>
            Glibc-2.25
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="binutils-pass2.html" title=
          "Binutils-2.27 - Pass 2">Next</a>
          <p>
            Binutils-2.27 - Pass 2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter05.html" title=
          "Chapter&nbsp;5.&nbsp;Constructing a Temporary System">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 8.0-systemd">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
